Optimal. Leaf size=18 \[ -i \tanh ^{-1}(\sin (x))-\cos (x)+i \sin (x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 18, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 7, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.636, Rules used = {3599, 3187,
3186, 2718, 2672, 327, 212} \begin {gather*} i \sin (x)-\cos (x)-i \tanh ^{-1}(\sin (x)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 327
Rule 2672
Rule 2718
Rule 3186
Rule 3187
Rule 3599
Rubi steps
\begin {align*} \int \frac {\sec (x)}{i+\cot (x)} \, dx &=-\int \frac {\tan (x)}{-\cos (x)-i \sin (x)} \, dx\\ &=i \int (-i \cos (x)-\sin (x)) \tan (x) \, dx\\ &=i \int (-i \sin (x)-\sin (x) \tan (x)) \, dx\\ &=-(i \int \sin (x) \tan (x) \, dx)+\int \sin (x) \, dx\\ &=-\cos (x)-i \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\sin (x)\right )\\ &=-\cos (x)+i \sin (x)-i \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (x)\right )\\ &=-i \tanh ^{-1}(\sin (x))-\cos (x)+i \sin (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(44\) vs. \(2(18)=36\).
time = 0.04, size = 44, normalized size = 2.44 \begin {gather*} -\cos (x)+i \left (\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )+\sin (x)\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 33 vs. \(2 (16 ) = 32\).
time = 0.21, size = 34, normalized size = 1.89
method | result | size |
risch | \(-{\mathrm e}^{-i x}+i \ln \left ({\mathrm e}^{i x}-i\right )-i \ln \left ({\mathrm e}^{i x}+i\right )\) | \(33\) |
default | \(-i \ln \left (\tan \left (\frac {x}{2}\right )+1\right )+\frac {2 i}{-i+\tan \left (\frac {x}{2}\right )}+i \ln \left (\tan \left (\frac {x}{2}\right )-1\right )\) | \(34\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 45 vs. \(2 (14) = 28\).
time = 0.28, size = 45, normalized size = 2.50 \begin {gather*} -\frac {2}{\frac {i \, \sin \left (x\right )}{\cos \left (x\right ) + 1} + 1} - i \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) + i \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 33 vs. \(2 (14) = 28\).
time = 3.70, size = 33, normalized size = 1.83 \begin {gather*} {\left (-i \, e^{\left (i \, x\right )} \log \left (e^{\left (i \, x\right )} + i\right ) + i \, e^{\left (i \, x\right )} \log \left (e^{\left (i \, x\right )} - i\right ) - 1\right )} e^{\left (-i \, x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec {\left (x \right )}}{\cot {\left (x \right )} + i}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 29 vs. \(2 (14) = 28\).
time = 0.41, size = 29, normalized size = 1.61 \begin {gather*} \frac {2 i}{\tan \left (\frac {1}{2} \, x\right ) - i} - i \, \log \left (\tan \left (\frac {1}{2} \, x\right ) + 1\right ) + i \, \log \left (\tan \left (\frac {1}{2} \, x\right ) - 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.25, size = 21, normalized size = 1.17 \begin {gather*} -\mathrm {atanh}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )\,2{}\mathrm {i}+\frac {2{}\mathrm {i}}{\mathrm {tan}\left (\frac {x}{2}\right )-\mathrm {i}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________